import React, { Component } from 'react'
import Index from './components/Index'
import { Popconfirm, message } from 'antd'


export default class List extends Component {
    state ={
        manageList:[
            {id:1,name:"lhs",role:0},
            {id:2,name:"jsj",role:1},
            {id:3,name:"bth",role:2}
        ]
    }
    confirm=(e)=>{
        // console.log(e);
        message.success('删除成功！');
      }
      
    cancel=(e)=> {
        // console.log(e);
        message.error('删除失败！');
      }
    render() {
        const {manageList} = this.state
        return (
            <div>
                <Popconfirm
                    title="你确认要删除这一条信息嘛？"
                    onConfirm={this.confirm}
                    onCancel={this.cancel}
                    okText="确认"
                    cancelText="取消"
                >
                    <button>删除</button>
                </Popconfirm>
                <Index manageList={manageList}/>
            </div>
        )
    }
}
